Read Dataset Records
Use this endpoint for time-, depth-, engineering-, and reference-dataset records.
GET
https://data.corva.ai/api/v1/data/{provider}/{dataset}/Path parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
provider | String | Required | Provider that owns the dataset definition, such as corva. |
dataset | String | Required | Dataset name, such as wits or completion.wits. |
Query parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
limit | Integer | Required | Number of records to return, from 1 through 10,000. |
query | JSON object | Optional | Conditions such as asset_id, company_id, or a timestamp range. |
sort | JSON object | Optional | Field directions, using 1 for ascending and -1 for descending. |
skip | Integer | Optional | Matching records to skip; defaults to 0. |
fields | String | Optional | Comma-separated fields to return. |
include_count | Boolean | Optional | Adds the match count to the Total response header. |
Example: latest drilling records
- cURL
- Python
- JavaScript
curl --get 'https://data.corva.ai/api/v1/data/corva/wits/' \
--header "Authorization: API ${CORVA_API_KEY}" \
--data-urlencode 'query={"asset_id":12345}' \
--data-urlencode 'sort={"timestamp":-1}' \
--data-urlencode 'limit=100' \
--data-urlencode 'fields=timestamp,asset_id,data.hole_depth,data.bit_depth'
import json
import os
import requests
response = requests.get(
"https://data.corva.ai/api/v1/data/corva/wits/",
headers={"Authorization": f"API {os.environ['CORVA_API_KEY']}"},
params={
"query": json.dumps({"asset_id": 12345}),
"sort": json.dumps({"timestamp": -1}),
"limit": 100,
"fields": "timestamp,asset_id,data.hole_depth,data.bit_depth",
},
timeout=30,
)
response.raise_for_status()
records = response.json()
const params = new URLSearchParams({
query: JSON.stringify({ asset_id: 12345 }),
sort: JSON.stringify({ timestamp: -1 }),
limit: '100',
fields: 'timestamp,asset_id,data.hole_depth,data.bit_depth',
});
const response = await fetch(
`https://data.corva.ai/api/v1/data/corva/wits/?${params}`,
{ headers: { Authorization: `API ${process.env.CORVA_API_KEY}` } }
);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const records = await response.json();
Response
[
{
"asset_id": 12345,
"timestamp": 1710000000,
"data": {
"hole_depth": 10342.5,
"bit_depth": 10340.8
}
}
]
An empty array is a successful response with no matching records. Verify the asset, provider, dataset, and query range before treating it as an error.
Example pagination loop
cursor = 0
records = []
while True:
page = requests.get(
"https://data.corva.ai/api/v1/data/corva/wits/",
headers=headers,
params={
"query": json.dumps({
"asset_id": 12345,
"timestamp": {"$gt": cursor},
}),
"sort": json.dumps({"timestamp": 1}),
"limit": 10000,
},
timeout=30,
)
page.raise_for_status()
batch = page.json()
if not batch:
break
records.extend(batch)
cursor = batch[-1]["timestamp"]